import request from '@/utils/request.js'

// 查询不同状态下的多订单
export function apiGetOrderList(data){
	return request({
		url:'/order/list',
		method:'post',
		data:data
	})
}

// 通过商店Id查询多个订单
export function apiGetOrderListByStoreId(data){
	return request({
		url:'/order/selectListByStoreId',
		method:'post',
		data:data
	})
}

// 通过商品Id查询多个订单
export function apiGetOrderListByProductId(data){
	return request({
		url:'/order/selectListByProductId',
		method:'post',
		data:data
	})
}

// 查询订单详情
export function apiGetOrderDetail(params){
	return request({
		url:'/order',
		method:'get',
		params:params
	})
}
// 接口慎用!!!!!!!!!
// 更新订单
export function apiEditOrder(data){
	return request({
		url:'/order',
		method:'put',
		data:data
	})
}

// 修改订单状态为已配送
export function apiEditOrderSended(data){
	return request({
		url:'/order/sended',
		method:'put',
		data:data
	})
}

// 修改订单状态为已送达
export function apiEditOrderArrived(data){
	return request({
		url:'/order/arrived',
		method:'put',
		data:data
	})
}

// 修改订单状态为已签收
export function apiEditOrderGot(data){
	return request({
		url:'/order/got',
		method:'put',
		data:data
	})
}

// 修改订单状态为已取消
export function apiEditOrderCancel(data){
	return request({
		url:'/order/cancel',
		method:'put',
		data:data
	})
}

// 删除订单
export function apiDelOrder(id){
	return request({
		url:'/order/'+id,
		method:'delete'
	})
}
// 批量删除
export function apiDelOrders(ids){
	return request({
		url:'/order/'+ids,
		method:'delete'
	})
}

// 新增订单
export function apiAddOrder(data){
	return request({
		url:'/order',
		method:'post',
		data:data
	})
}